﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KATS_Server
{
    /// <summary>
    /// Manages the encrytion algorithims
    /// </summary>
    public static class Encryption
    {
        /// <summary>
        /// Is the encryption class being debugged
        /// </summary>
        static bool Debug = false;

        /// <summary>
        /// Encryt the message
        /// </summary>
        /// <param name="message">The message to encryt</param>
        /// <returns>The encrypted message</returns>
        public static string Encrypt(string message)
        {
            string e = EncryptionMethods.RijndaelM.Encrypt(message);
            if (Debug)
            {
                Console.WriteLine("Encrypting:" + message);
                Console.WriteLine("Encrypted :" + e);
            }
            return e;
        }

        /// <summary>
        /// Decrypt the message
        /// </summary>
        /// <param name="message">The encrpyted message</param>
        /// <returns>The decrypted message</returns>
        public static string Decrypt(string message)
        {
            string d = EncryptionMethods.RijndaelM.Decrypt(message);
            if (Debug)
            {
                Console.WriteLine("Decrypting :" + message);
                Console.WriteLine("Decrypted :" + d);
            }
            return d;
        }
    }
}
